<template>
    <div>
        <label for="">
            <input type="text" v-model="inputData">
        </label>
        <button @click="add">添加</button>
    </div>
</template>

<script>
export default {
    data(){
        return {
            inputData:''
        }
    },
    methods:{
        add(){
            if(this.inputData.length > 0){
                this.$emit('gettopson',this.inputData)
                this.inputData = ''
            }
        }
    }
}
</script>

<style>

</style>